Skip to content

Conversation

Achintya-Chatterjee
Copy link
Member

@Achintya-Chatterjee Achintya-Chatterjee commented Jul 9, 2025

Date: July 9, 2025

Developer Name: @Achintya-Chatterjee


Issue Ticket Number

Description

  • Updated the API contract according to the sorting tasks feature

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1

Test Coverage

Screenshot 1

Additional Notes

Description by Korbit AI

What change is being made?

Update the API contract for the GET /v1/tasks endpoint to include sorting functionality by adding sort_by and order query parameters.

Why are these changes being made?

These changes are made to enhance the functionality of the GET /v1/tasks endpoint by allowing users to sort tasks based on specified fields like "createdAt", "dueAt", "priority", and "assignee". This change provides users greater flexibility in how they retrieve and view their tasks, aligning with feature requests for better task management capabilities.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@Achintya-Chatterjee Achintya-Chatterjee self-assigned this Jul 9, 2025
Copy link

coderabbitai bot commented Jul 9, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • Documentation
    • Updated the documentation for the tasks endpoint to include new sorting options with sort_by and order query parameters. Now users can sort tasks by creation date, due date, priority, or assignee, with clear defaults for each field.

Walkthrough

The documentation for the GET /v1/tasks endpoint was updated to describe new optional query parameters for sorting: sort_by and order. The documentation now details the supported fields for sorting, their default sort orders, and clarifies that sorting works alongside pagination.

Changes

File(s) Change Summary
todo-backend/README.md Updated API documentation for GET /v1/tasks to include sort_by and order query parameters.

Assessment against linked issues

Objective Addressed Explanation
Add sort_by and order query parameters to GET /v1/tasks documentation (#64)
Document supported sort fields: priority, due date, created date, assignee (#64)
Document default sort orders for each field (#64)
Clarify that sorting works with pagination and existing filters (#64)
Document error handling for invalid sort parameters (#64) Documentation does not mention 400 Bad Request or error details for invalid sort parameters.

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Possibly related PRs

Suggested reviewers

  • AnujChhikara
  • iamitprakash

Poem

In the meadow of tasks, a breeze now flows,
Sorting by date, by assignee, it goes.
With order and field, your list can be neat,
Just add the right query—your tasks can’t be beat!
🐇✨

— A happy doc-bunny


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've completed my review and didn't find any issues... but I did find this bear.

/  \.-"""-./  \
\    -   -    /
 |   o   o   |
 \  .-'''-.  /
  '-\__Y__/-'
     `---`

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🔭 Outside diff range comments (2)
todo-backend/README.md (2)

63-65: Update the description row to reflect new sorting capability

The table row still says “Return all tasks with pagination”. Now that the endpoint supports sorting, please amend the description so that the overview stays accurate and avoids surprising integrators.


138-141: Pagination metadata key should be total, not count

Per our prior agreement (see learning note 842-851), the canonical field for total items is total. Using count here re-introduces inconsistency.

-      "count":"number"
+      "total": "number"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3788c8 and 279afa4.

📒 Files selected for processing (1)
  • todo-backend/README.md (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: shobhan-sundar-goutam
PR: Real-Dev-Squad/website-api-contracts#247
File: todo-backend/README.md:842-851
Timestamp: 2025-07-03T17:32:29.706Z
Learning: In the Real-Dev-Squad/website-api-contracts todo-backend API, "total" is the decided field name for pagination metadata in API responses, not "count".
Learnt from: shobhan-sundar-goutam
PR: Real-Dev-Squad/website-api-contracts#247
File: todo-backend/README.md:819-852
Timestamp: 2025-07-03T17:31:12.448Z
Learning: In the Real-Dev-Squad/website-api-contracts todo-backend API, response formats are inconsistent across endpoints - some endpoints include statusCode and sucessMessage fields while others don't. Documentation should reflect actual implementation behavior rather than force artificial consistency.
todo-backend/README.md (2)
Learnt from: shobhan-sundar-goutam
PR: Real-Dev-Squad/website-api-contracts#247
File: todo-backend/README.md:819-852
Timestamp: 2025-07-03T17:31:12.448Z
Learning: In the Real-Dev-Squad/website-api-contracts todo-backend API, response formats are inconsistent across endpoints - some endpoints include statusCode and sucessMessage fields while others don't. Documentation should reflect actual implementation behavior rather than force artificial consistency.
Learnt from: shobhan-sundar-goutam
PR: Real-Dev-Squad/website-api-contracts#247
File: todo-backend/README.md:842-851
Timestamp: 2025-07-03T17:32:29.706Z
Learning: In the Real-Dev-Squad/website-api-contracts todo-backend API, "total" is the decided field name for pagination metadata in API responses, not "count".
🪛 LanguageTool
todo-backend/README.md

[grammar] ~74-~74: There might be a mistake here.
Context: ...n all tasks with pagination and sorting support - Params None - Query - Opti...

(QB_NEW_EN_OTHER)


[grammar] ~78-~78: Use correct spacing
Context: ...ting support - Params None - Query - Optional: page=[integer] (Page number...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~82-~82: There might be a mistake here.
Context: ...=[string]` (Field to sort by: "createdAt", "dueAt", "priority", "assignee", defaul...

(QB_NEW_EN_OTHER)


[grammar] ~82-~82: There might be a mistake here.
Context: ...` (Field to sort by: "createdAt", "dueAt", "priority", "assignee", default: "creat...

(QB_NEW_EN_OTHER)


[grammar] ~82-~82: There might be a mistake here.
Context: ...sort by: "createdAt", "dueAt", "priority", "assignee", default: "createdAt") - O...

(QB_NEW_EN_OTHER)


[grammar] ~82-~82: There might be a mistake here.
Context: ...eatedAt", "dueAt", "priority", "assignee", default: "createdAt") - Optional: `or...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: There might be a mistake here.
Context: ...onal: order=[string] (Sort order: "asc", "desc", default varies by field: create...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: There might be a mistake here.
Context: ...rder=[string]` (Sort order: "asc", "desc", default varies by field: createdAt: "de...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: There might be a mistake here.
Context: ...efault varies by field: createdAt: "desc", dueAt: "asc", priority: "desc", assigne...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: There might be a mistake here.
Context: ...by field: createdAt: "desc", dueAt: "asc", priority: "desc", assignee: "asc") - *...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: There might be a mistake here.
Context: ...t: "desc", dueAt: "asc", priority: "desc", assignee: "asc") - **Success Response:...

(QB_NEW_EN_OTHER)


[grammar] ~83-~83: Use correct spacing
Context: ...eAt: "asc", priority: "desc", assignee: "asc") - Success Response: - Code: 200 ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

Copy link

@anuj-flx anuj-flx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we not sorting by assignee name?

@Achintya-Chatterjee
Copy link
Member Author

Achintya-Chatterjee commented Jul 10, 2025

are we not sorting by assignee name?

Yes, I'm updating the contract

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Enhance GET v1/tasks/ API to support sorting by priority, due_date, created_date, and assignee
2 participants